<h1><?php echo $fund['name'] ?></h1>
<ul id="breadcrumb">	
	<li><span>ใบสำคัญการลงบัญชี</span></li>	
	<li><span>ปิดบัญชี</span></li>	
	<li><?php echo 'ปีงบประมาณ '.($year+543) ?></li>		
</ul>
<div id="content">
		<div class="search">
		<form method="get">
			<label>ปีงบประมาณ </label><?php echo form_dropdown('year', get_year_option('2550'),$year+543); ?>
		<?php if(level_data('view')): ?>
		&nbsp;&nbsp;<label>หน่วยงาน </label><?php echo form_dropdown('agency_id', get_agency_option($fund['id']),$agency_id,'','ทุกหน่วยงาน'); ?>
		<?php endif; ?>
			&nbsp;<input type="submit" value="<?php echo lang('search'); ?>" class="button" />
			<?php if(!empty($_GET['mode'])): ?>
		<?php echo form_hidden('mode', @$_GET['mode']); ?>
		<?php endif; ?>
		</form>
	</div>
<table class="list">
	<tr>
		<th width="100">วันที่</th>
		<th width="100">เลขที่</th>
		<th width="100">ประเภท</th>
		<th>คำอธิบาย</th>
		<th width="180">ผู้ลงบัญชี</th>
		<th width="200">
			<?php if(close_budget($fund['id'])): ?>
			<a class="button" href="voucher/close/view/<?php echo $fund['id'] ?>"><span class="icon_text addnew"></span>เพิ่มรายการ</a>
			<?php else: ?>
			<img src="themes/fund/images/icon/lock.gif" />
			<?php endif; ?>
		</th>
	</tr>
	<?php if($result): ?>
	<? foreach($result as $key => $item): ?>
	<tr <?php echo cycle($key) ?>>
		<td class="center"><?php echo mysql_to_date($item['voucher_date'],TRUE)?></td>
		<td class="center"><?php echo $item['number']?></td>
		<td><?php echo $item['voucher_type_name']?></td>
		<td><?php echo ($item['description'])?$item['description']:$item['voucher_match_name']?></td>
		<td><?php echo $item['user_firstname'].' '.$item['user_lastname']?></td>
		<td class="center">
			
			<!--<a href="voucher/view/<?php echo $fund['id'] ?>/<?php echo $item['id'] ?><?php echo (!empty($item['mode']))?'?mode='.$item['mode']:'' ?>">รายละเอียด</a> -->
			<?php if(voucher_lock($item)): ?>
			<a class="button" href="voucher/form/<?php echo $fund['id'] ?>/<?php echo $item['id'] ?><?php echo (!empty($item['mode']))?'?mode='.$item['mode']:'' ?>"><span class="icon_text edit"></span>แก้ไข</a> 
			<a class="button" href="voucher/delete/<?php echo $item['id'] ?>" onclick="return confirm('<?php echo lang('confirm_delete')?>')" ><span class="icon_text cancel"></span>ลบ</a>
			<?php else: ?>
			<a href="voucher/view/<?php echo $fund['id'] ?>/<?php echo $item['id'] ?>">รายละเอียด</a> 
			<?php endif; ?>
		</td>
	</tr>
	<? endforeach; ?>
	<?php else: ?>
	<tr>
		<td colspan="6" class="center">- ไม่มีข้อมูล -</td>
	</tr>
	<?php endif; ?>
</table>
</div>